package org.zht.dormpro.auth.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.zht.dormpro.auth.bean.PageBean;
import org.zht.dormpro.auth.model.SysRole;

import java.util.List;

public interface SysRoleMapper {
    @Delete({"delete from sys_role where id = #{id,jdbcType=INTEGER}"})
    int deleteByPrimaryKey(Integer id);

    int insertSelective(SysRole record);

    @Select({"select",
        "id, name, available, remark, create_time, modify_time, creator, mender, role_append",
        "from sys_role",
        "where id = #{id,jdbcType=INTEGER}" })
    @ResultMap("org.zht.dormpro.auth.mapper.SysRoleMapper.BaseResultMap")
    SysRole selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(SysRole record);

    List<SysRole> getAllRole(@Param("all") int all);

    List<SysRole> getAllRoleByCondition(PageBean pageBean);
}